Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@aws-sdk/util-base64
Advanced tools
@aws-sdk/util-base64 is a utility package provided by AWS SDK for JavaScript. It offers functions to encode and decode Base64 strings, which are commonly used in data encoding and transmission.
Base64 Encoding
This feature allows you to encode a string into Base64 format. The `toBase64` function takes a string as input and returns its Base64 encoded version.
const { toBase64 } = require('@aws-sdk/util-base64');
const data = 'Hello, World!';
const encodedData = toBase64(data);
console.log(encodedData); // Outputs: 'SGVsbG8sIFdvcmxkIQ=='
Base64 Decoding
This feature allows you to decode a Base64 encoded string back to its original format. The `fromBase64` function takes a Base64 encoded string as input and returns the decoded string.
const { fromBase64 } = require('@aws-sdk/util-base64');
const encodedData = 'SGVsbG8sIFdvcmxkIQ==';
const decodedData = fromBase64(encodedData);
console.log(decodedData); // Outputs: 'Hello, World!'
The `base64-js` package provides utilities for encoding and decoding Base64 strings. It is a lightweight and efficient library that offers similar functionalities to @aws-sdk/util-base64, but it is not tied to AWS SDK.
The `js-base64` package is another popular library for Base64 encoding and decoding. It offers a simple API and is widely used in the JavaScript community. It provides similar functionalities to @aws-sdk/util-base64 but is more focused on general use cases.
The `buffer` package is a part of Node.js core libraries and provides a way to handle binary data, including Base64 encoding and decoding. It is more versatile and can handle various binary data manipulations, making it a more comprehensive solution compared to @aws-sdk/util-base64.
3.374.0 (2023-07-20)
FAQs
A Base64 <-> UInt8Array converter
We found that @aws-sdk/util-base64 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.